Use data sources to separate the user interface from the application data and to remove the dependencies between a Kanzi Studio project and the application code which define the Kanzi application. More...
Public Member Functions | |
void | close () |
Close the object, and release native resources. | |
DataObject | getData () |
Retrieves the root object of the underlying data tree. | |
DataContext | lookupDataContext (String relativePath) |
Performs object look-up by path. | |
Public Member Functions inherited from DataContext | |
ModifiedSubscriptionToken | addModifiedNotificationHandler (ModifiedSubscriptionFunction modifiedHandlerFunction) |
Allows to subscribe to modifications in this data context. | |
void | notifyModified () |
Triggers modification procedure in this data context, which invokes the subscriptions. | |
void | removeModifiedNotificationHandler (DataContext.ModifiedSubscriptionToken token) |
Removes a modification subscription. | |
Public Member Functions inherited from Resource | |
String | getName () |
Gets the resource name. | |
String | getUrl () |
Gets the resource URL. | |
void | setKeepAlive (boolean keepAlive) |
Sets the keep alive flag. | |
Public Member Functions inherited from KanziObject | |
boolean | equals (Object object) |
Domain | getDomain () |
Returns the domain the object belongs to. | |
Metaclass | getDynamicMetaclass () |
Returns the metaclass of the dynamic type of the object. | |
long | getNative () |
Gets a pointer to the backing C++ instance. | |
TDataType | getOptionalProperty (PropertyType< TDataType > propertyType) |
Returns the current value of a property type, but does not use the default value if there are no inputs to the property value. | |
TDataType | getProperty (PropertyType< TDataType > propertyType) |
Returns the current value of a property type. | |
int | hashCode () |
boolean | hasValue (PropertyType< TDataType > propertyType) |
Evaluates whether there are any inputs into the property value. | |
boolean | isStale () |
Test if the object is stale i.e. | |
void | removeLocalValue (PropertyType< TDataType > propertyType) |
Removes the local value associated with the property. | |
void | setProperty (PropertyType< TDataType > propertyType, TDataType value) |
Sets the local value of a property type. | |
ObjectRef< TType > | tryCreateObjectRef (Class< TType > clazz) |
Tries to create an owning ObjectRef instance to this KanziObject. | |
Static Public Attributes | |
static final Metaclass | metaclass |
The Metaclass for the class. | |
Static Public Attributes inherited from DataContext | |
static final Metaclass | metaclass |
The Metaclass for the class. | |
Static Public Attributes inherited from Resource | |
static final Metaclass | metaclass |
The Metaclass for the class. | |
Static Public Attributes inherited from KanziObject | |
static final Metaclass | metaclass = new AbstractMetaclass("Kanzi.Object") |
The Metaclass for the class. | |
Protected Member Functions | |
DataSource (Domain domain, long nativeObject, Metaclass metaclass) | |
Wraps a given native DataSource Called by KanziObject.connectResource(long) when connecting to a native DataSource. | |
void | initialize () |
Initializes the DataSource. | |
void | onLoaded () |
Override function called after loadFromKZB. | |
Static Protected Member Functions | |
static< Derived extends DataSource > ObjectRef< Derived > | createDerived (Domain domain, String name, Metaclass metaclass) |
Creates a derived class instance. | |
Additional Inherited Members | |
Public Attributes inherited from ResourceMetadata | |
AbstractMetaclass | metaclass = new AbstractMetaclass("Kanzi.Resource") |
Metaclass for Resource. | |
Public Attributes inherited from DataContextMetadata | |
DynamicPropertyType< Resource > | DataContextProperty |
Source of data for this node and its descendants. | |
DynamicPropertyType< Resource > | ItemsSourceProperty |
Data object which provides data sources for list items. | |
AbstractMetaclass | metaclass = new AbstractMetaclass("Kanzi.DataContext") |
Metaclass for DataContext. | |
Public Attributes inherited from DataSourceMetadata | |
AbstractMetaclass | metaclass = new AbstractMetaclass("Kanzi.DataSource") |
Metaclass for DataSource. | |
Use data sources to separate the user interface from the application data and to remove the dependencies between a Kanzi Studio project and the application code which define the Kanzi application.
Kanzi allows you to define the format and structure of your data source by defining a Kanzi Engine data source plugin.
When you use a data source in a Kanzi application you bind the values of properties and property fields to data that comes from a data source. This binding establishes a connection between a node or a resource and the application data. When data in the data source changes, the nodes and resources which are bound to the data reflect the change in the data.
To set a node to use a data source, use the DataContext.DataContext property. When you set the Data Context property for a node, all its child nodes inherit the value of the Data Context property. After you set a node to use a data source, you can use bindings to access the data.
|
protected |
Wraps a given native DataSource Called by KanziObject.connectResource(long) when connecting to a native DataSource.
domain | UI Domain where this DataSource belongs |
nativeObject | Native object that is backing this DataSource |
metaclass | Metaclass data for this DataSource |
|
staticprotected |
Creates a derived class instance.
Call this method as part of the create method for a derived class.
domain | UI Domain where this data source belongs. |
name | Name of the data source |
metaclass | Metaclass data of the data source. |
DataObject getData | ( | ) |
Retrieves the root object of the underlying data tree.
Reimplemented from DataContext.
DataContext lookupDataContext | ( | String | relativePath | ) |
Performs object look-up by path.
relativePath | Path of the object where to look at, separated by '.'. |
Reimplemented from DataContext.